Skip to content

Use native submenus for new-tab agent setup - #37576

Merged
nwparker merged 8 commits into
mainfrom
nwparker/tab-menu-2
Nov 3, 2026
Merged

nwparker merged 8 commits into
mainfrom
nwparker/tab-menu-2

Conversation

@nwparker

@nwparker nwparker commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​525 $\color{#cf222e}{\Huge{\mathbf{−}}}$​160 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​365
Prod 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​401 $\color{#cf222e}{\Huge{\mathbf{−}}}$​84 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​317

ELI5

The new-tab agent picker now opens a native submenu from the separate right-hand chevron. Launch buttons have equal dimensions, with Enter for the default mode and Cmd+Enter (Mac) or Ctrl+Enter (Windows/Linux) for the alternative.

What Changed

  • Use shadcn/Radix submenu primitives for placement, collision handling, pointer handoff, and keyboard navigation. Keep standalone setup popovers for search results.
  • Only hovering or clicking the segmented > opens options. Hovering the name/icon keeps options closed; clicking the main item launches its default mode. The whole row highlights, and the chevron uses the normal neutral filled-button colors on hover, keyboard focus, and while open.
  • Preserve Radix pointer grace and wheel highlighting while requiring explicit chevron/Right Arrow opening. Suppress a row launch when a press on its main section is released over the chevron.
  • Autofocus model search on opening. Right Arrow opens options; Left Arrow from empty search returns focus to the agent row. Typed search, Arguments, prompts, composition, nested controls, and Escape retain their editing/navigation behavior.
  • Give both launch buttons equal grid columns and matching shadcn sizes. Show shortcut hints using ShortcutKeyCombo, with platform-appropriate modifier labels and accessible shortcut metadata.
  • Route the alternative launch shortcut through the existing composer submission path, preserving prompt, pending attachments, setup drafts, and launch choices. Ignore held repeats, composition, disabled launches, and unavailable alternative modes.

Why

The picker needs the placement and navigation users expect from a cascading menu, while preserving one-click default launching. Matching launch buttons and visible shortcuts make both launch modes discoverable.

Visual Proof

Captured through Playwright CDP in the hidden Electron renderer using the visual-proof and electron skills. Workspace nwparker/tab-menu-2, viewport 1728×1080, 710×530 crops following the submenu. The current captures include the loaded model list.

Before: unequal launch buttons After: equal buttons and launch shortcuts
Before: unequal launch buttons After: matching launch buttons in dark mode

Light mode, opened with Right Arrow and model search focused:

Matching launch buttons in light mode

Windows modifier labels, emulated through the renderer user agent on macOS (not native Windows validation):

Ctrl+Enter alternative launch hint

Testing

  • Final GitHub CI on 87b8f176863: full PR workflow passed, including all 12 unit-test shards, static analysis/typecheck, macOS and Windows package builds, selection evidence, and the PR checks passed aggregate gate.

  • CI follow-up: all 42 tests in the two failing launch integration/search files pass after selecting launch buttons by accessible name. Updated the drag regression to include the resulting click, and added wheel-highlight and left-opening pointer-grace coverage; 53 related pointer/menu tests pass.

  • Hidden Electron follow-up: main hover stays closed, chevron hover focuses search, Left/Right returns/reopens, dragging onto the chevron does not launch, wheel scrolling focuses the row under the pointer, and a collision-flipped submenu stays open while crossing another row.

  • 150 scoped tests across 13 files covering picker setup, launch choices, prompt retention, inventory freshness, submenu navigation, pointer handoff, and highlighting. Includes 25 shortcut cases across Mac/Windows/Linux labels and bindings, both default modes, prompt/search/Arguments focus, empty prompts, and guarded states.

  • Hidden Electron: Cmd+Enter from Codex model search opened the alternative Codex Chat tab. Equal button dimensions verified in dark/light mode (141.703125 × 24 px), Windows label emulation (151.6875 × 24 px), and a 600×800 viewport (137.5 × 24 px).

  • Electron: chevron-only opening, whole-row highlighting, matching neutral hover/keyboard fill, search autofocus, Right/Left/Right navigation, typed-search caret behavior, Arguments/prompt editing, and narrow collision placement.

  • Commit hooks passed lint, AST checks, and formatting.

  • pnpm check:changed --maxWorkers=2 --timeout=2: all 23 non-test checks passed, including Node/web typechecks, changed-code quality, formatting, localization, and ratchets. The broad related test selection exceeded the two-minute cap; the 150-test scoped suite passed. The full selection and package builds subsequently passed in GitHub CI.

Native rendered validation was on macOS. Windows/Linux shortcut behavior is covered by tests; Windows labels were also renderer-emulated. Live SSH and native Windows/Linux were not exercised. This change uses the existing host-independent launch path and adds no new persistence or platform process behavior.

Risk

Level: Medium. Focus transitions and shortcut routing could affect submenu dismissal, nested controls, or launch choice. Focused tests and the actual Electron flow cover those paths. A plain revert restores the prior menu; no data migration is involved.

Review

  • Self-reviewed correctness, accessibility, and performance; no new polling or closed-row subscriptions.
  • Cross-platform shortcuts, folder workspaces, remote hosts, mobile sizing, and existing drafts considered.
  • No upstream skill-installer content copied or translated.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The picker now presents setup panels as dropdown submenus. The setup button supports submenu and popover rendering. Dropdown menus gain controlled open-state handling, a close hook, and submenu styling variants. Picker launch rows update their click and keyboard behavior. Tests cover submenu interactions, keyboard navigation, and menu closing after launches.

Merge Risk: Low · up to 57d57

The menu can launch an agent during a drag, retain a stale highlight while scrolling, or close a setup panel during pointer movement. These bounded interaction issues warrant owner awareness before merging.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description is well-developed and covers most template sections: ELI5, What Changed, Why, Visual Proof (before/after images and light/dark/Windows-label captures), a detailed Testing section with … Fill in the Linked Issue section with an actual issue number (replace 'Fixes #'). Complete the AI Disclosure section, or state that the author is a team member and the section does not apply. Tick the manual testing checkbox if it is true, …
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: replacing the new-tab agent setup interaction with native submenus.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 10 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Full details: Description check

Explanation

The description is well-developed and covers most template sections: ELI5, What Changed, Why, Visual Proof (before/after images and light/dark/Windows-label captures), a detailed Testing section with checkboxes, Risk with a level and revert plan, and Review checkboxes. Several items are incomplete or missing. The Linked Issue section reads 'Fixes #' with no issue number, though the objectives cite PR #37576 and the template requires an issue for outside contributors. The 'Notes' and 'Checklist' sections are not reproduced, and the 'AI Disclosure' section is empty. The 'Agent skill upstream boundary' checkbox is not ticked. The Testing section says the author manually tested, but the first checkbox is not ticked. The 'Risk' section does not name the riskiest part in detail beyond focus transitions and shortcut routing, and it does not name the affected platforms beyond macOS, Windows, and Linux.

Resolution

Fill in the Linked Issue section with an actual issue number (replace 'Fixes #'). Complete the AI Disclosure section, or state that the author is a team member and the section does not apply. Tick the manual testing checkbox if it is true, and tick or justify the Agent skill upstream boundary checkbox. Add a clear note on Linux and Windows coverage in Testing, because the description says native Windows and Linux were not exercised. Confirm the Checklist items, including whether the PR is small and focused, given its size of about 925 changed lines across 19 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f22490d9-b4e3-42ad-b839-0be45afe61dc
Commits

Reviewing files that changed from the base of the PR and between e5909a6 and 57d5773.

Files selected for processing: 5
  • src/renderer/src/components/agent/AgentLaunchPickerMenu.keyboard.test.tsx
  • src/renderer/src/components/agent/AgentLaunchPickerMenu.test.tsx
  • src/renderer/src/components/agent/AgentLaunchSetupSubmenu.tsx
  • src/renderer/src/components/ui/button.tsx
  • src/renderer/src/components/ui/dropdown-menu.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

@nwparker
nwparker merged commit a3fd5c2 into main Nov 3, 2026
42 checks passed
AmoabaKelvin added a commit that referenced this pull request Nov 5, 2026
… submenu

The @ and / suggestion list lifts itself to the menu layer only inside a
popover. Since #37576 the new-tab agent setup is a dropdown submenu on the
same z-[70] layer, so the list stayed at z-50 and drew behind it.
AmoabaKelvin added a commit that referenced this pull request Nov 5, 2026
… submenu (#38328)

The @ and / suggestion list lifts itself to the menu layer only inside a
popover. Since #37576 the new-tab agent setup is a dropdown submenu on the
same z-[70] layer, so the list stayed at z-50 and drew behind it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant